package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @className: com.example.demo.mapper-> StudentMapper
 * @description: 学生数据库接口类
 * @author: 刘幸
 * @createDate: 2021-04-26 15:02
 * @version: 1.0
 * @todo:
 */
@Mapper
public interface StudentMapper extends BaseMapper<Student> {
    @Select("select * from student limit #{page},#{limit}")
    List<Student> getPageStudent(int page, int limit);

    @Select("select count(id)  from student")
    int getStudentCount();


    @Update("update student set ${field} = #{value} where id = #{id}")
    int  updateStudentById(int id,String field,String value);
}
